package com.zhiziai.aiproxy.constants;

import java.util.Arrays;

/**
 * @author: liuxinyu06
 * @description: 文件上传类型
 * @create: 2022-08-15
 **/
public enum UploadType {

    DALLE("dalle","dalle生成图片","/dalle/","c/"),
    MIDJOURNEY("midjourney","mj生成图片","/midjourney/","c/"),
    ;

    private String type;
    private String desc;
    private String path;
    private String prefix;

    UploadType(String type, String desc, String path, String prefix) {
        this.type = type;
        this.desc = desc;
        this.path = path;
        this.prefix = prefix;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public String getPath() {
        return path;
    }

    public String getPrefix() {
        return prefix;
    }

    public static UploadType getByType(String type){
        return Arrays.stream(UploadType.values()).filter(item -> item.getType().equals(type)).findFirst().orElse(null);
    }
}
